<!-- Study_FreeCourseRichtextNew.html -->
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>描述</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css" />
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/base.css">
		<style type="text/css">
			body {
				background-color: #FFFFFF
			}
			.content_text {
				word-break: break-all;
				word-wrap: break-word;
				/*text-align:left;*/
				padding: 10px;
				padding-bottom: 50px;
			}
			/*#richTextContent p:nth-child(1){
			 text-indent: 2em;
			 }*/
			.content_title {
				word-break: break-all;
				word-wrap: break-word;
				text-align: center;
				padding: 10px;
			}
			table {
				border: 1px solid #ccc;
				border-collapse: collapse;
				border-spacing: 0;
			}
			td, th {
				border: 1px solid #ccc;
				padding: 0;
			}
			ul li {
				list-style: disc;
			}
			ol li {
				list-style: decimal;
			}
			.white_div {
				background-color: white;
				height: 1px;
			}
			.butom {
				margin-top: 5px;
				width: 100%;
				padding-top: 10px;
				padding-bottom: 10px;
				font-size: 18px;
				display: block;
				color: #fff;
			border: 1px solid  #ff9900;
				background-color: #ff9900;
			}
			.but_bottom {
				bottom: 0px;
				width: 100%;
				position: fixed;
				/*padding-left: 10px;
				 padding-right: 10px;*/
				text-align: center;
			}
			p {
				color: #6;
				/*font-size: 14px;*/
			}
		</style>
	</head>
	<body>
		<div style="margin-right: 10px;margin-left: 10px;padding-top:10px;height: 200px"  class="base_none_item " id="voide" onclick="toPlayVideo()">
			<img src="../../image/img_voide.png" style="width: 100%;height: 100%;" />
		</div>
		<div class="content_text base_dark_grey base_content_font" id="richTextContent"></div>
		<div class="but_bottom" class="base_none_item ">
			<button id="sumbit_bt" type="button" class="  butom" onclick="Upload_data()">
				进入学习
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript">
		var url = "";
		//视频地址
		apiready = function() {
			loadData();
		}
		function loadData() {
			if (api.pageParam.content_type == 'hdresource') {//互动资源
				var type = $api.getStorage('cfnetSelectType');
				if (type == 0) {//展现学生端4个功能按钮
					$('#sumbit_bt').text("开始学习");
				}
				$('#but_bottom').show();
			}
			url = api.pageParam.path;
			if (url != "" && url != null && url != undefined) {
				$("#voide").show();
			}
			var bewrite = api.pageParam.bewrite;
			setupRichText(api.pageParam.bewrite);
		}

		function setupRichText(other) {
			other = other.replace(/\+/g, " ");
			var newWidth = api.winWidth;
			other = other.replace("width:420;", "width='" + newWidth + "'");
			$api.html($api.byId('richTextContent'), other);
			setupImage();
		}

		function setupImage() {
			var newWidth = api.winWidth - 20;
			$("img").each(function(i) {
				var oldWith = $(this).width();
				if (oldWith == 0) {
					setTimeout(function() {
						setupImage();
					}, 500);
					return;
				}
				if (oldWith > newWidth) {
					var oldHeight = $(this).height();
					var newHeight = oldHeight * (newWidth / oldWith);
					$(this).width(newWidth);
					$(this).height(newHeight);
				}
			});
		}

		function backClick() {
			api.closeWin({
			});
		}

		function toPlayVideo() {
			var videoPlayer = api.require('videoPlayer');
			videoPlayer.play({
				path : url,
				texts : {
					head : {
						title : api.pageParam.title
					}
				},
				styles : {
					head : {
						backSize : 24,
						backImg : 'widget://image/vp_back.png',
						setSize : 24,
						setImg : 'widget://image/vp_more.png'
					},
					foot : {
						playSize : 24,
						playImg : 'widget://image/vp_play.png',
						pauseImg : 'widget://image/vp_pause.png',
						nextSize : 24,
						nextImg : 'widget://image/vp_next.png'
					}
				}
			}, function(ret, err) {
			});
		}

		function Upload_data() {
			if (api.connectionType == 'none') {
				api.toast({
					msg : '暂无网络，无法访问该内容'
				});
				return;
			}
			
			
			api.pageParam['sourceurl']=window.location.pathname;
			api.pageParam['sourcetitle']=document.title;
			
			api.openWin({useWKWebView:true,
				name : 'student_study_freecourse_interactiveNew',
				url : '../Study/student_study_freecourse_interactiveNew.html',
				pageParam : api.pageParam
			});
		}
	</script>
</html>
